import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'widgets/security_menu_item.dart';

class SecurityCenterScreen extends StatelessWidget {
  final List<String> menuItems = [
    'Agreement',
    'Privacy Policy',
    'Child Safety Policy',
    'Anti bullying policy',
    'Cookie Policy',
    'Legal Advice',
    'Intellectual Property Policy',
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.black,
      body: SafeArea(
        child: Column(
          children: [
            // 头部
            Container(
              color: const Color(0xFF151313),
              padding: EdgeInsets.symmetric(vertical: 35.h),
              child: Row(
                children: [
                  GestureDetector(
                    onTap: () => Get.back(),
                    child: Padding(
                      padding: EdgeInsets.only(left: 30.w),
                      child: Icon(
                        Icons.arrow_back_ios,
                        color: Colors.white,
                        size: 48.sp,
                      ),
                    ),
                  ),
                  Expanded(
                    child: Center(
                      child: Text(
                        'Security Center',
                        style: TextStyle(
                          color: Colors.white,
                          fontSize: 36.sp,
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                    ),
                  ),
                  SizedBox(width: 78.w), // 为了保持标题居中
                ],
              ),
            ),
            // 菜单列表
            Expanded(
              child: ListView.separated(
                padding: EdgeInsets.symmetric(horizontal: 30.w, vertical: 30.h),
                itemCount: menuItems.length,
                separatorBuilder: (context, index) => SizedBox(height: 30.h),
                itemBuilder: (context, index) {
                  return SecurityMenuItem(
                    title: menuItems[index],
                    onTap: () {
                      // 处理菜单项点击
                      print('Clicked: ${menuItems[index]}');
                    },
                  );
                },
              ),
            ),
          ],
        ),
      ),
    );
  }
}
